From: Lukáš Tyrychtr Date: Tue, 24 Sep 2024 11:44:15 +0000 (+0200) Subject: bluetooth: When the placeholder is shown, announce it when reaching the toggle X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~194^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5286df3f9db81375a14a43f4d75a5ed5ee82dff6;p=gnome-shell.git bluetooth: When the placeholder is shown, announce it when reaching the toggle Previously, the menu would be just empty, without any indication why. Part-of: (cherry picked from commit 3bd68fcfd7a1088e26f8631f27f73e67581413a2) --- diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index 5d3581c42..5797de8ad 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -1,5 +1,6 @@ import 'gi://GnomeBluetooth?version=3.0'; +import Atk from 'gi://Atk'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GnomeBluetooth from 'gi://GnomeBluetooth'; @@ -335,9 +336,19 @@ class BluetoothToggle extends QuickMenuToggle { : _('Turn on Bluetooth to connect to devices'); } + _updatePlaceholderRelation() { + const accel = this.get_accessible(); + const placeholderAccel = this._placeholderItem.get_accessible(); + if (this._deviceSection.actor.visible) + accel.remove_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel); + else + accel.add_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel); + } + _updateDeviceVisibility() { this._deviceSection.actor.visible = [...this._deviceItems.values()].some(item => item.visible); + this._updatePlaceholderRelation(); } _getSortedDevices() {